Scanner and non-transitory storage medium storing instructions executable by the scanner

ABSTRACT

A scanner includes: a communication device communicable with an information processing device; and a controller. The controller is configured to cause the scanner to execute: a determination processing in which the scanner determines whether a reading request which is a request for reading a pseudo image file is received from the information processing device; a scan executing processing in which the scanner executes a scan processing when the reading request for reading the pseudo image file is received in the determination processing; and a scan-data writing processing in which the scanner writes scan data created in the scan executing processing, into the pseudo image file.

CROSS REFERENCE TO RELATED APPLICATION

The present application claims priority from Japanese Patent ApplicationNo. 2014-065722, which was filed on Mar. 27, 2014, the disclosure ofwhich is herein incorporated by reference in its entirety.

BACKGROUND

1. Technical Field

The present invention relates to a scanner communicable with aninformation processing device and to a non-transitory storage mediumstoring a plurality of instructions executable by a processor of thescanner.

2. Description of the Related Art

In the case where an information processing device such as a PC(Personal Computer) acquires scan data, the information processingdevice needs to call a driver of a scanner from an application programusing an API (Application Programming Interface) to transmit a scaninstruction to the scanner using the called driver. That is, a userneeds to install the scan driver on the PC in advance.

SUMMARY

Accordingly, an aspect of the disclosure relates to a technique forallowing an information processing device to acquire scan data from ascanner without using a driver.

In one aspect of the disclosure, a scanner includes: a communicationdevice communicable with an information processing device; and acontroller configured to cause the scanner to execute: a determinationprocessing in which the scanner determines whether a reading requestwhich is a request for reading a false image file is received from theinformation processing device; a scan executing processing in which thescanner executes a scan processing when the reading request for readingthe false image file is received in the determination processing; and ascan-data writing processing in which the scanner writes scan datacreated in the scan executing processing, into the false image file.

In another aspect of the disclosure, a scanner includes: a communicationdevice communicable with an information processing device; a storageconfigured to store a file; and a controller configured to cause thescanner to execute: a reception determining processing in which thescanner determines whether a command for execution of reading of thefile is received from the information processing device via thecommunication device; a scan executing processing in which the scannerexecutes a scan processing when the scanner determines that the commandis received in the reception determining processing; and a scan-datatransmitting processing in which the scanner transmits scan data createdin the scan executing processing, to the information processing devicevia the communication device.

In another aspect of the disclosure, a non-transitory storage mediumstores a plurality of instructions executable by a processor of ascanner. The scanner includes a communication device communicable withan information processing device. The plurality of instructions, whenexecuted by the processor, cause the scanner to execute: a determinationprocessing in which the scanner determines whether a reading requestwhich is a request for reading a false image file is received from theinformation processing device; a scan executing processing in which thescanner executes a scan processing when the reading request for readingthe false image file is received in the determination processing; and ascan-data writing processing in which the scanner writes scan datacreated in the scan executing processing, into the false image file.

In another aspect of the disclosure, a non-transitory storage mediumstores a plurality of instructions executable by a processor of ascanner. The scanner includes: a communication device communicable withan information processing device; and a storage configured to store afile. The plurality of instructions, when executed by the processor,cause the scanner to execute: a reception determining processing inwhich the scanner determines whether a command for execution of readingof the file is received from the information processing device via thecommunication device; a scan executing processing in which the scannerexecutes a scan processing when the scanner determines that the commandis received in the reception determining processing; and a scan-datatransmitting processing in which the scanner transmits scan data createdin the scan executing processing, to the information processing devicevia the communication device.

BRIEF DESCRIPTION OF THE DRAWINGS

The objects, features, advantages, and technical and industrialsignificance of the present disclosure will be better understood byreading the following detailed description of the embodiments, whenconsidered in connection with the accompanying drawings, in which:

FIG. 1 is a block diagram illustrating a communication system;

FIG. 2 is a flow chart illustrating processings executed by a scanner;

FIG. 3 is a flow chart illustrating processings executed by the scanner;

FIG. 4 is a flow chart illustrating processings executed by the scanner;

FIG. 5 is a flow chart illustrating processings executed by the scanner;

FIG. 6 is a flow chart illustrating processings executed by the scanner;

FIG. 7 is a flow chart illustrating processings executed by the scanner;

FIG. 8 is a flow chart illustrating processings executed by the scanner;

FIG. 9 is a flow chart illustrating processings executed by a scanneraccording to a second embodiment;

FIG. 10 is a flow chart illustrating processings executed by the scanneraccording to the second embodiment;

FIG. 11 is a flow chart illustrating processings executed by the scanneraccording to the second embodiment;

FIG. 12 is a flow chart illustrating processings executed by a scanneraccording to a third embodiment;

FIG. 13 is a flow chart illustrating processings executed by the scanneraccording to the third embodiment;

FIG. 14 is a flow chart illustrating processings executed by a scanneraccording to a fourth embodiment; and

FIG. 15 is a flow chart illustrating processings executed by the scanneraccording to the fourth embodiment.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Configuration of Communication System

FIG. 1 illustrates a communication system 1 according to a firstembodiment. The communication system 1 includes a scanner 10, a PC(Personal Computer) 30 (as one example of an information processingdevice), a PC 50, and a network 52.

A configuration of the scanner 10 will be explained. The scanner 10includes a CPU (Central Processing Unit) 12 (as one example of acontroller and a processor), a storage device 14, a panel 16, a buttoninput device 18, a reading device 20, a network interface 22 (as oneexample of a communication device), and a USB interface 23 (as anotherexample of the communication device). These devices are communicablewith each other via an input/output port 24.

The panel 16 has a display surface for displaying various kinds offunctions of the scanner 10. The button input device 18 includes keysfor execution of the various functions of the scanner 10 and may beprovided as a touch panel superposed on the panel 16. The reading device20 creates image data by scanning a document placed on an ADF (AutomaticDocument Feeder) or a flat bed.

The network interface 22 can communicate with external devices over thenetwork 52 and is connected to the PCs 30, 50 over the network 52. Thisconfiguration allows the scanner 10 to transmit and receive variouskinds of data to and from the PCs 30, 50. It is noted that an SMB(Server Message Block) protocol is used in communication between thescanner 10 and the PCs 30, 50 over the network 52.

Also, a USB cable 25 is connected to the USB interface 23, and the USBinterface 23 is connected to the PC 30 via the USB cable 25. Thisconfiguration allows the scanner 10 to transmit and receive variouskinds of data to and from the PC 30. The USB interface 23 includes aninterface of a storage class and an interface of a vendor class.

The CPU 12 executes processings according to a scan program 26 (as oneexample of a plurality of instructions) stored in the storage device 14.The scan program 26 is a program for execution of the scan processing.Hereinafter, the CPU 12 that executes programs such as the scan program26 may be simply referred to as the name of the program. For example,the wording “the scan program 26 executes” may mean “the CPU 12 thatexecutes the scan program 26 executes”.

It is noted that the storage device 14 is constituted by a combinationof a RAM (Random Access Memory), a ROM (Read Only Memory), a flashmemory, a HDD (Hard Disk Drive), a buffer provided for the CPU 12, andother similar devices. The storage device 14 has a data storage area 28(as one example of a storage). The data storage area 28 stores variouskinds of data including: image data created by the reading device 20;and data required for execution of the scan program 26.

A configuration of the PC 30 will be explained. The PC 30 includes a CPU32, a storage device 34, a display 36, a keyboard 38, a networkinterface 40, and a USB interface 42. These devices are communicablewith each other via a bus 44.

The display 36 has a display surface for displaying various kinds offunctions of the PC 30. The keyboard 38 is provided with keys forexecution of the various functions of the PC 30.

The network interface 40 communicates with external devices over thenetwork 52 and is connected to the scanner 10 over the network 52. Thisconfiguration allows the PC 30 to transmit and receive various kinds ofdata to and from the scanner 10. It is noted that the SMB protocol isused in communication between the scanner 10 and the PC 30 over thenetwork 52.

The USB cable 25 is connected to the USB interface 42, and the USBinterface 42 is connected to the scanner 10 via the USB cable 25. Thisconfiguration allows the PC 30 to transmit and receive various kinds ofdata to and from the scanner 10. It is noted that a USB storage class isused in the communication between the scanner 10 and the PC 30 via theUSB cable 25.

The CPU 32 executes processings according to an image processingapplication program 46 stored in the storage device 34. The imageprocessing application program 46 is a program for processing imagedata. Hereinafter, the CPU 32 that executes programs such as the imageprocessing application program 46 may be simply referred to as the nameof the program. For example, the wording “the image processingapplication program 46 executes” may mean “the CPU 32 that executes theimage processing application program 46 executes”.

It is noted that the storage device 34 is constituted by a combinationof a RAM, a ROM, a flash memory, a HDD, a buffer provided for the CPU32, and other similar devices. The storage device 34 has a data storagearea 48 (as one example of a storage). The data storage area 48 is anarea for storing various kinds of data including: image data acquiredfrom the scanner 10; and data required for execution of the imageprocessing application program 46.

The PC 50 is substantially similar in configuration to the PC 30 butconnected to the scanner 10 over the network 52.

Scan Processing Using Named Pipe

The image processing application program 46 of the PC 30 is configuredto read image data and process the image data. This image processingapplication program 46 does not have a function for calling API of ascanner driver or a function for directly controlling the scanner. Sucha program is common in image uploaders and other similar devices. In thepresent embodiment, a named pipe as one example of a false image file ora pseudo image file is used for causing the image processing applicationprogram to read scan image.

The named pipe is a file having the following features:

(1) Data written in the named pipe is read out in first-in-first-outorder.

(2) Data read out from the named pipe is deleted from the named pipe.

(3) When file opening is commanded with respect to the named pipe in awrite blocking mode, opening processing is delayed until another processperforms reading with respect to the named pipe.

This named pipe is common in Unix and Linux (registered trademark).

The scan program 26 is installed on the scanner 10, and the scanner 10uses the scan program 26 to offer scan image to the image processingapplication program 46 via the named pipe. The image processingapplication program 46 uses the SMB protocol or the USB storage class toread the named pipe as the file like a normal image file to read thescan data. A file name of this named pipe is attached with an extensionrepresentative of image data such as JPG. An image format representativeof the extension coincides with that of the scan data.

A user can perform various kinds of settings by operating the buttoninput device 18 of the scanner 10. One of the settings is a backup mode.In this mode, the scan data utilizing the named pipe is stored into thedata storage area 28 of the scanner 10.

When setting of the setting values for the scan processing and settingfor the backup mode are performed, the scan program 26 createsdirectories in the data storage area 28 of the scanner 10 and each setof setting values for the scan processing which are set in a settingmode are set to a corresponding one of the directories. Specifically,for example, two directories are created, and color scanning and asetting value of a resolution of 200×200 dpi are set in a firstdirectory, and black and white scanning and a setting value of aresolution of 400×400 dpi are set in a second directory. In the casewhere there are a plurality of settings, subordinate directories arecreated, and the settings are assigned respectively to the subordinatedirectories. That is, the scan settings are hierarchically managed usingthe directories.

The named pipe is then created for each created directory. Specifically,according to the scan program 26, the set setting values for the scanprocessing are read, and the setting values for the scan processing areextracted for each directory. The named pipe is then created for eachdirectory according to the setting values for the scan processing. It isnoted that in the case where the backup mode is set in the setting mode,the named pipe whose pipe name (i.e., the name of the pipe) containsinformation about a serial number is created, and in the case where thebackup mode is not set in the setting mode, the named pipe whose pipename does not contain information about a serial number is created. Uponcreation of the named pipe, the blocking mode is set for the creatednamed pipe, and an open processing is executed.

When the scanner 10 is connected to the PC 30 via the USB interface 23,the PC 30 requests the scanner 10 to transmit a descriptor. In response,the scanner 10 transmits a descriptor indicating that the scanner 10 hasthe storage class and the vendor class. Upon receiving the descriptor,the PC 30 recognizes that the scanner 10 includes a storage device. As aresult, in the case where the OS installed in the PC 30 is a Windows(registered trademark), for example, the PC 30 creates a new driveletter (e.g., “E:”). Also, in the case where the scanner 10 is connectedto the PC 30 via the network interface 22, the PC 30 recognizes, basedon a file sharing protocol such as the SMB protocol, that a storagedevice is connected to the CPU 30. The PC 30 recognizes that thedirectory and the named pipe are stored in a new recording apparatusrecognized in this manner.

In the case where the named pipe is read by the image processingapplication program 46 of the PC 30, the setting values for the scanprocessing which are set for the named pipe are acquired according tothe scan program 26. Then, a scan processing is executed by the scanprogram 26 based on the acquired setting values, and scan data iscreated in the scan processing. The scan program 26 writes the scandata, which is created in the scan processing to the named pipe read bythe image processing application program 46. Accordingly, the scan datawritten in the named pipe is acquired using the image processingapplication program 46 of the PC 30. That is, the image processingapplication program 46 of the PC 30 can read the scan data created bythe scanner 10 with the same operation as performed in reading of anormal image file stored in the data storage area 28. This configurationallows the PC 30 to acquire the scan data from the scanner 10 withoutusing any scanner driver. Also, since no scanner driver is required, thescanner 10 can perform scanning without depending upon architecture ofthe PC 30 (i.e., a type of a CPU) or a platform (i.e., a type of an OS).It is noted that the PC 30 may use any of the SMB protocol and the USBstorage class to read the named pipe. That is, the PC 30 can read thenamed pipe over the network 52 and via the USB cable 25.

When the scan data written in the named pipe is acquired by the PC 30,the named pipe is switched to an inactive state in which the named pipecannot be used. That is, the named pipe is closed. The named pipe isthen deleted from the data storage area 28. However, after the namedpipe being deleted, another named pipe is created again so as to be in ausable state in the above-described manner. In the case where the backupmode is set, the scan data written in the pipe that has been deleted isstored into the data storage area 28 under the same name as that of thepipe. It is noted that when a new named pipe is created, the serialnumber is incremented. As a result, the scan data remains under the samename as that of the named pipe used for reading.

The image processing application program 46 of the PC 50 has thefunction for calling the API of the scanner driver and can transmit ascan instruction to the scanner 10. Thus, when having received a scaninstruction from the PC 50, the scanner 10 executes a scan processing.In the case where the scanner 10 is connected to the PC 50 via the USB,reading using the function for calling the API is performed via theinterface of the vendor class. Also, the scanner 10 may execute a scanprocessing according to a user operation performed on the button inputdevice 18 of the scanner 10. Specifically, an input waiting screen, notshown, is normally displayed on the panel 16 of the scanner 10, and theinput waiting screen contains a scan-processing execution button, notshown. The scanner 10 executes a scan processing in response to a useroperation performed on the scan-processing execution button.

As thus described, the scanner 10 can execute three types of scanprocessings, namely, a scan processing utilizing the named pipe, a scanprocessing according to a scan instruction transmitted from the PC 50,and a scan processing according to a button operation performed on thescanner 10. A plurality of processings of these three types of scanprocessings may be input, and in this case, a processing which is inputfirst is executed first, and a processing which is input later is in awaiting state.

Specifically, while the scan processing utilizing the named pipe or thescan processing according to the scan instruction transmitted from thePC 50 is being executed, for example, a BUSY screen, not shown, isdisplayed on the panel 16 of the scanner 10, instead of the inputwaiting screen. Since the scan processing is being executed, informationdisplayed on the BUSY screen includes a comment indicating that the scanprocessing according to the button operation cannot be executed. Thescan-processing execution button is not displayed on the BUSY screen. Asa result, the scan processing according to the button operationperformed on the scanner 10 is in the waiting state.

When a scan instruction is received from the PC 50 while the scanprocessing utilizing the named pipe or the scan processing according tothe button operation performed on the scanner 10 is being executed, forexample, the scanner 10 transmits a BUSY status to the PC 50. As aresult, an error is displayed on a display of the PC 50. Thus, a user ofthe PC 50 recognizes that another user is using the scanner 10, andwaits for the scan processing.

While the scan processing according to the scan instruction transmittedfrom the PC 50 or the scan processing according to the button operationperformed on the scanner 10 is being executed, for example, the readpermissions for all the named pipes stored in the data storage area 28are disallowed. As a result, the named pipe cannot be read, and an erroris displayed during a reading processing. Thus, the user recognizes thatanother user is using the scanner 10, and waits for the scan processing.

While one of the scan processing utilizing the named pipe, the scanprocessing according to the scan instruction transmitted from the PC 50,and the scan processing according to the button operation performed onthe scanner 10 is being executed, start triggers for the other twoprocessings may be input. For example, while the scan processingaccording to the button operation performed on the scanner 10 is beingexecuted, reception of the scan instruction from the PC 50 and readingof the named pipe may be performed. In this case, one of the scanprocessing utilizing the named pipe, and the scan processing accordingto the scan instruction transmitted from the PC 50 may be executed witha higher priority than the other according to a preset priority rule.

In this case, the priority rule may be set as desired. For example, thescan processing utilizing the named pipe (in the case where the USBstorage class is used in reading of the named pipe) may be given ahigher priority than the scan processing according to the scaninstruction transmitted from the PC 50, the scan processing utilizingthe named pipe (in the case where the SMB protocol is used in reading ofthe named pipe). Also, the scan processing according to the buttonoperation performed on the scanner 10 may be given a higher prioritythan the scan processing utilizing the named pipe. A scan processing forwhich a start trigger has been input first may be given a higherpriority between the scan processing utilizing the named pipe (in thecase where the SMB protocol is used in reading of the named pipe) andthe scan processing according to the scan instruction transmitted fromthe PC 50.

Scan Program

Each of the scan processing utilizing the named pipe, the scanprocessing according to the scan instruction transmitted from the PC 50,and the scan processing according to the button operation performed onthe scanner 10 is executed by the CPU 12 of the scanner 10 according tothe scan program 26. There will be next explained, with reference toFIGS. 2-8, flows of processings executed by the CPU 12 according to thescan program 26. It is noted that a flow in the setting mode isdigressed from the essence of the present invention and will not beexplained.

The scan program 26 is executed when the scanner 10 is started up. Whenthe scan program 26 is executed, the flow begins with S100 at which adirectory corresponding to the scan settings is created in the datastorage area 28 of the scanner 10 if the directory does not exist. Inthis processing, the setting values for the scan processing which areset in the setting mode are set for each directory. For example, in thecase where the print settings include resolutions of 300 dpi and 600 dpiand color scanning and monochrome scanning as a scan mode, directoriesare created as follows:

. . . /RESO300 dpi/color;

. . . /RESO300 dpi/mono;

. . . /RESO600 dpi/color; and

. . . /RESO600 dpi/mono

The CPU 12 at S102 creates pipe monitoring processes corresponding tothe lowest level of the above-described directory (S102). The CPU 12 atS104 determines whether all pipe monitoring processes each for thedirectories which is created at S100 and which is stored in the datastorage area 28 have been created or not. When all the pipe monitoringprocesses are not created (S104: NO), this flow returns to S102. Whenall the pipe monitoring processes are created (S104: YES), the CPU 12 atS106 creates a command monitoring process. The CPU 12 at S108 creates apanel-operation monitoring process and at S110 creates anexclusion-monitoring and permission-setting process. As a result of theprocessings described above, the plurality of pipe monitoring processes,the command monitoring process, the panel-operation monitoring process,the exclusion-monitoring, and permission-setting process are executed inparallel.

In each pipe monitoring process, as illustrated in FIG. 3, the CPU 12 atS120 reads the setting values for the scan processing which are set foreach directory. The CPU 12 at S122 determines whether the backup mode isset in the setting mode or not. When the backup mode is not set (S122:NO), a named pipe having the fixed name is created at S124 in thecorresponding directory. For example, in the case where this pipemonitoring process is created corresponding to the directory “/RESO300dpi/color”, this named pipe, the file name of which is fixed name, iscreated in the directory “/RESO300 dpi/color”. When the backup mode isset (S122: YES), a named pipe whose pipe name contains information abouta serial number is at S126 created in the directory.

When the named pipe is created, the CPU 12 at S128 executes a pipe openprocessing. In this processing, a writing-only mode and the blockingmode are designated. In the blocking mode, associated processings arestopped until writing is possible. In the case where an open processingis commanded in this mode, this open processing is switched to theblocking state (i.e., a processing-stopped state) until the named pipeis read. When this open processing is finished, in other words, whenreading of the named pipe is requested from an external device (e.g.,the image processing application program 46 of the PC 30), the pipe openprocessing is finished, and this flow goes to S130.

The CPU 12 at S130 determines whether the current state is an excludingstate or not. The excluding state is a state in which when a starttrigger for the scan processing is input, for example, when reading ofthe named pipe is requested from the external device in this case,execution of a scan processing in response to the start trigger isdisallowed on condition that another scan processing has been executed.This excluding state is started at another Step.

When the current state is the excluding state (S130: YES), the CPU 12 atS132 waits until the excluding state is finished. When the excludingstate is finished, this flow goes to S134. Also when the current stateis not the excluding state (S130: NO), this flow goes to S134. The CPU12 at S134 starts an excluding state. The CPU 12 at S136 executes a scanprocessing based on the setting values set in the directory storing theread named pipe. The CPU 12 at S138 writes the scan data created in thescan processing, into the named pipe.

The CPU 12 at S140 determines whether a predetermined length of time haspassed from the reading of the named pipe or not. When the predeterminedlength of time has not passed (S140: NO), the CPU 12 at S142 determineswhether all the scan processings are finished or not. When all the scanprocessings are not finished (S142: NO), this flow returns to S136. Whenall the scan processings are finished (S142: YES), this flow goes toS144. Also when the predetermined length of time has passed at S140(S140: YES), this flow goes to S144. In this case, an incomplete imageis read by the PC 30 as an error, and the image is normally determinedas an invalid image and processed as an error by an application havingread the image.

The CPU 12 at S144 finishes the excluding state. The named pipe used forthe scan processing is at S146 switched to the inactive state. That is,the named pipe is closed. At S148, the closed named pipe is deleted fromthe directory. The CPU 12 at S150 determines whether the backup mode isset or not. When the backup mode is set (S150: YES), the CPU 12 at S152stores the scan data under the same name as that of the deleted namedpipe. The CPU 12 at S154 increments the serial number by one, and thisflow returns to S122.

In the command monitoring process, as illustrated in FIG. 6, the CPU 12at S160 determines whether a command such as a scan instruction has beeninput from the external device such as the PC 50 or not. When thecommand is not input (S160: NO), the CPU 12 repeats the processing atS160. When the command is input (S160: YES), the CPU 12 at S162determines whether the current state is the excluding state or not. Whenthe current state is the excluding state (S162: YES), the CPU 12 at S164transmits the BUSY status to the external device having transmitted thecommand, and this flow returns to S160.

When the current state is not the excluding state (S162: NO), the CPU 12at S166 starts an excluding state. The CPU 12 at S168 executes a scanprocessing based on the command. The CPU at S170 transmits scan datacreated in the scan processing, to the external device havingtransmitted the command. The CPU 12 at S172 finishes the excludingstate, and this flow returns to S160.

In the panel-operation monitoring process, as illustrated in FIG. 7, theCPU 12 at S180 determines whether the current state is the excludingstate or not. When the current state is the excluding state (S180: YES),the CPU 12 at S182 controls the panel 16 of the scanner 10 to displaythe BUSY screen, and this flow returns to S180.

When the current state is not the excluding state (S180: NO), the CPU 12at S184 controls the panel 16 of the scanner 10 to display the inputwaiting screen. The CPU 12 at S186 determines whether thescan-processing execution button has been operated on the input waitingscreen or not. When the scan-processing execution button is operated(S186: YES), the CPU 12 at S188 starts an excluding state. The CPU 12 atS190 executes the scan processing. The CPU at S192 transmits the scandata created in the scan processing, to an external device registered inadvance. The CPU 12 at S194 finishes the excluding state, and this flowreturns to S180. It is noted that also when the scan-processingexecution button is not operated at S186 (S186: NO), this flow returnsto S180.

In the exclusion-monitoring and permission-setting process, asillustrated in FIG. 8, the CPU 12 at S200 waits for switching of theexclusion state. The CPU 12 at S202 determines whether the current stateis the excluding state or not as a result of the switching of theexclusion state. When the current state is the excluding state (S202:YES), the CPU 12 at S204 disallows the read permission for the namedpipe, and this flow returns to S200. It is noted that in the case wherethe excluding state is started at S134, in other words, in the casewhere the excluding state is started by reading of the pipe, reading ofthe pipe that is currently read is not disallowed in this pipe-readingdisallowing processing at S204. When the current state is not theexcluding state (S202: NO), the CPU 12 at S206 allows the readpermission for the named pipe, and this flow returns to S200.

It is noted that the processing executed by the CPU 12 at S128 is oneexample of a determination processing. The processing executed by theCPU 12 at S136 is one example of a scan executing processing. Theprocessing executed by the CPU 12 at S138 is one example of a scan-datawriting processing. The processings executed by the CPU 12 at S124 andS126 are one example of a false-image-file creating processing. Theprocessing executed by the CPU 12 at S146 is one example of afalse-image-file closing processing. The processing executed by the CPU12 at S204 is one example of a restricting processing. The processingexecuted by the CPU 12 at S206 is one example of a canceling processing.

Second Embodiment

While the named pipe is created in the data storage area 28 of thescanner 10 in the above-described embodiment, the named pipe may becreated in the data storage area 48 of the PC 30. Specifically,authentication of the SMB protocol is performed between the scanner 10and the PC 30. In the case where this authentication has succeeded, thescanner 10 acquires a permission for accessing the PC 30 and determines,based on the permission for accessing the PC 30, whether various kindsof data can be written into the data storage area 48 of the PC 30 ornot. When the various kinds of data can be written into the data storagearea 48, the scanner 10 creates a named pipe in the data storage area 48of the PC 30. It is noted that in the case where the authentication ofthe SMB protocol has not succeeded between the scanner 10 and the PC 30or in the case where various kinds of data cannot be written into thedata storage area 48, an error screen is displayed on the panel 16 ofthe scanner 10.

When the named pipe is created in the data storage area 48 of the PC 30,the pipe open processing is executed as in the first embodiment. Whenreading of the named pipe is requested from the image processingapplication program 46 of the PC 30, the pipe open processing isfinished, and the scanner 10 executes a scan processing. Scan datacreated in the scan processing is written, using the SMB protocol, intothe named pipe created in the data storage area 48 of the PC 30. As thusdescribed, the same effects as obtained in the first embodiment can beobtained by creating the named pipe in the data storage area 48 of thePC 30.

There will be next explained, with reference to FIGS. 9-11, a flow ofprocessings executed by the CPU 12 according to the scan program 26 toexecute the processings in the above-described second embodiment. It isnoted that the flow which will be explained below is a pipe monitoringprocess which is executed instead of the pipe monitoring processillustrated in FIG. 2. It is noted that the present pipe monitoringprocess is executed in the state in which the backup mode is set.

In the present pipe monitoring process, as illustrated in FIG. 9, theCPU 12 at S210 reads setting values for a scan processing which are setfor each directory. At S212, the authentication of the SMB protocol isperformed between the scanner 10 and the PC 30. The CPU 12 at S214determines whether the authentication of the SMB protocol has succeededor not. When the authentication of the SMB protocol has succeeded (S214:YES), the scanner 10 at S216 acquires a permission for accessing the PC30.

Based on the acquired permission, the CPU 12 at S218 determines whethervarious kinds of data can be written into the data storage area 48 ofthe PC 30 or not. When the various kinds of data can be written into thedata storage area 48 of the PC 30 (S218: YES), a named pipe whose pipename contains information about a serial number is at S220 created inthe directory of the data storage area 48.

When the named pipe is created, the CPU 12 at S222 determines whetherthe current state is the excluding state or not. When the current stateis the excluding state (S222: YES), the CPU 12 at S224 waits until theexcluding state is finished. When the excluding state is finished, thisflow goes to S226. Also when the current state is not the excludingstate (S222: NO), this flow goes to S226. The CPU 12 at S226 executes apipe open processing. The CPU 12 then executes processings at S228 andsubsequent steps, but these processings are the same as the respectiveprocessings at S136-S148, S152, and S154 in the pipe monitoring processin the first embodiment, and an explanation of which is dispensed with.

It is noted that when the authentication of the SMB protocol has notsucceeded at S214 (S214: NO) or when various kinds of data cannot bewritten into the data storage area 48 of the PC 30 at S218 (S218: NO),the CPU 12 at S246 controls the panel 16 of the scanner 10 to display anerror screen, and this flow returns to S212.

It is noted that the processing executed by the CPU 12 at S226 isanother example of the determination processing. The processing executedby the CPU 12 at S228 is another example of the scan executingprocessing. The processing executed by the CPU 12 at S230 is anotherexample of the scan-data writing processing. The processing executed bythe CPU 12 at S220 is another example of the false-image-file creatingprocessing. The processing executed by the CPU 12 at S238 is anotherexample of the false-image-file closing processing.

Third Embodiment

In the present embodiment, a named pipe which is assumed not to be usedby the user can be deleted. For example, in the case where an errorhaving occurred in the scanner 10 inhibits execution of a particularscan processing, a directory set for the particular scan processing issearched, and a named pipe stored in the searched directory is deleted.Specifically, in the case where the ADF is failed, and a scan processingcannot be executed for a document placed on the ADF, the CPU 12 searchesa directory set for a scan processing for a document placed on the ADFand deletes a named pipe stored in the searched directory. A text filein which an error message has been written is created in the directory.As a result, in the case where reading is performed from the PC 30 tothe directory by the user for scanning, for example, the user finds thetext file in the directory instead of the pipe as the false image file.The error message contains a comment indicating that the scan processingusing the ADF cannot be performed due to the failure in the ADF, andthereby the user of the PC 30 recognizes that the scan processing usingthe ADF cannot be performed.

In the case where the error is cleared, and thereby the particular scanprocessing can be restarted, the directory set for the particular scanprocessing is searched, and the text file in which the error message hasbeen written is deleted from the searched directory. A named pipe isthen created again in the directory. Specifically, in the case where thefailed ADF is recovered, the directory set for the scan processing forthe document placed on the ADF is searched, and the text file stored inthe searched directory is deleted. A named pipe is then created again inthe directory. As a result, the scan processing for the document placedon the ADF can be executed in the scan processing utilizing the namedpipe.

Not only in the case where an error has occurred but also in the casewhere the scan processing utilizing the named pipe is being executed,named pipes other than the named pipe for which the scan processing isto be executed are also deleted. A text file in which a BUSY message hasbeen written is created in a directory in which the deleted named pipehad been stored. The BUSY message contains a comment indicating that anew scan processing cannot be accepted because the scan processing isbeing executed. Having viewed the BUSY message, the user of the PC 30recognizes that the scan processing cannot be executed at this time.

When the scan processing is finished, the named pipe which is deletedbefore is created again. Also, the text file in the directory forstoring the named pipe created again is deleted. As a result, the scanprocessing utilizing the named pipe can be executed again.

There will be next explained, with reference to FIGS. 12 and 13, a flowof processings executed by the CPU 12 according to the scan program 26to execute the processings in the above-described third embodiment. Itis noted that the flow which will be explained below is a scannermonitoring process and can be created after, e.g., the processing atS110 in the flow illustrated in FIG. 2. In the scanner monitoringprocess, as illustrated in FIG. 12, the CPU 12 at S280 determineswhether an error has occurred in the scanner 10 or not.

When an error has occurred (S280: YES), the CPU 12 at S282 searches adirectory set for setting values relating to the error. The CPU 12 atS284 deletes a named pipe stored in the searched directory. The CPU 12at S286 creates text file in which an error message has been written, inthe directory which had stored the deleted named pipe, and this flowreturns to S280.

When an error has not occurred at S280 (S280: NO), the CPU 12 at S288determines whether the error has been cleared or not. When the error iscleared (S288: YES), the CPU 12 at S290 searches the directory set forthe setting values relating to the cleared error. The CPU 12 at S292deletes the text file stored in the searched directory. The CPU 12 atS294 creates the named pipe again in the searched directory, and thisflow returns to S280.

When the error is not cleared at S288 (S288: NO), the CPU 12 at S296determines whether the scan processing utilizing the named pipe is beingexecuted or not. When the scan processing is being executed (S296: YES),the CPU 12 at S298 deletes all the named pipes other than the named pipecorresponding to the scan processing being executed. The CPU 12 at S300creates a text file in which a BUSY message is written, in the directorythat had stored the deleted named pipe, and this flow returns to S280.

When the scan processing is not being executed at S296 (S296: NO), theCPU 12 at S302 determines whether the scan processing is completed ornot. When the scan processing is completed (S302: YES), the CPU 12 atS304 creates the named pipe again in a directory in which no errormessage is written. The CPU 12 at S306 deletes the text files containingthe BUSY messages, from all the directories, and this flow returns toS280.

It is noted that the processing executed by the CPU 12 at S280 is oneexample of a state acquiring processing. The processing executed by theCPU 12 at S284 is one example of a pseudo-image-file deletingprocessing. In the above-described embodiment, causes (e.g., an errorand “BUSY”) of hindrance to scanning are not detected at the same timebut may be detected at the same time. In this case, in the case wherethe directory has already stored the text file in which the errormessage has been written, a message for another cause newly detected isadditionally written into the text file. In this case, where the causeis cleared, the CPU 12 deletes only the error message relating to thecleared cause. In the case where all the error messages are deleted, theCPU 12 deletes the text file and creates a named pipe again in thedirectory.

Fourth Embodiment

In the above-described embodiments, the CPU executes the scan processingutilizing the named pipe, i.e., the pseudo image file providedvirtually. However, the CPU may monitor a processing command providedfor the file system and change processings as needed. In the case wherethe scanner and the PC are connected to each other using USB, the fileis processed using a command of the storage class in most cases. Inconnection over the network, the file is processed using a commandaccording to the SMB protocol. The CPU monitors these commands, and whenthe CPU determines that a request for reading the file is received, theCPU transmits a file of a read image as a response. Specifically, anempty image file (hereinafter may be referred to as “scan activationfile”) is created in advance in a directory stored in the data storagearea 28 of the scanner 10. This scan activation file is attached with anextension representative of image data such as JPG. An image formatrepresentative of the extension coincides with that of the scan data. Inthe case where the scan activation file is read, a scan processing isexecuted. It is noted that determination of whether the scan activationfile has been read or not is performed not based on whether the scanactivation file has actually been read or not (that is, whether the scanactivation file has been accessed or not) but based on a command usedwhen reading the scan activation file. That is, the CPU monitors acommand input to the scanner 10 and determines whether the input commandis for the scan activation file or not. When the input command is forthe scan activation file, the CPU determines whether a content of thecommand is reading of the file or not. When the content of the commandis the reading of the file, the CPU determines that the scan activationfile is to be read.

When the scan activation file is to be read, the scanner 10 executes ascan processing. A file based on the scan data created in the scanprocessing is then transmitted to an external device having transmittedthe command, as a file for which the reading processing is executed. Asthus described, the same effects as obtained in the first embodiment canbe obtained by using a normal file instead of the named pipe.

There will be next explained, with reference to FIGS. 14 and 15, a flowof processings executed by the CPU 12 according to the scan program 26to execute the processings in the above-described fourth embodiment. Itis noted that the flow which will be explained below is a filemonitoring process which is created in the flow in FIG. 2 instead of thepipe monitoring process. This flow is for explaining a concept and doesnot coincide with the actual command of the USB storage class or the SMBprotocol.

In the file monitoring process, as illustrated in FIG. 14, this flowbegins with S250 at which the CPU 12 waits for input of a command of theSMB protocol or the USB storage class for a file stored in the scanner10. The CPU 12 at S252 determines whether the input command is for thescan activation file or not. When the command is for the scan activationfile (S252: YES), the CPU 12 at S254 determines whether the content ofthe command is reading of the file or not. When the content of thecommand is the reading of the file (S254: YES), the CPU 12 at S256starts an excluding state.

The CPU 12 at S260 determines whether the scan activation file containsscan data or not. This file is an empty image file as an initial value,but in the case where this function has already been used, this file maystore an image created in the previous scanning. When the scanactivation file contains scan data (S260: YES), the CPU 12 at S262deletes the scan data, and this flow goes to S264. When the scanactivation file contains no scan data (S260: YES), this flow goes toS264 at which the CPU 12 executes a scan processing.

The CPU 12 at S266 creates scan data in the scan processing and storesthe created scan data as the scan activation file. The CPU 12 at S268transmits the scan data to an external device having transmitted thecommand, as a response to the file reading processing. The CPU 12 at 270finishes the excluding state, and this flow returns to S250.

When the command is not for the scan activation file at S252 (S252: NO)or when the content of the command is not the reading of the file atS254 (S254: NO), the CPU 12 at S258 executes a normal processing basedon the command, and this flow returns to S250.

It is noted that the processings executed by the CPU 12 at S252 and S254are one example of a reception determining processing. The processingexecuted by the CPU 12 at S264 is another example of the scan executingprocessing. The processing executed by the CPU 12 at S268 is one exampleof a scan-data transmitting processing.

While the embodiments have been described above, it is to be understoodthat the disclosure is not limited to the details of the illustratedembodiments, but may be embodied with various changes and modifications,which may occur to those skilled in the art, without departing from thespirit and scope of the disclosure. Specifically, the scan data isacquired in the case where the named pipe is read by the execution ofthe image processing application program 46 by the PC 30 in theabove-described embodiment, for example. However, the CPU can acquirethe scan data by reading of the named pipe during execution of a programsuch as a document creating program and a print processing program.

In the above-described embodiment, the excluding state is started in thecase where the scanner 10 has received the scan instruction from the PC50 when the scan processing is executed according to the scaninstruction transmitted from the PC 50. However, this communicationsystem 1 may be configured such that when the scanner driver is executedin the PC 50, the PC 50 transmits a predetermined signal to the scanner10, and when having received the predetermined signal, the scanner 10starts the excluding state. That is, the scanner 10 may start theexcluding state by execution of the scanner driver in the PC 50.

In the above-described embodiments, the processings illustrated in FIGS.2-15 are executed by the CPU 12. These processings do not need to beexecuted by the CPU 12 and may be executed by an ASIC or another orother similar logical integrated circuits and may be executed bycooperation of the CPU, the ASIC, and the logical integrated circuit,for example.

What is claimed is:
 1. A scanner, comprising: a communication devicecommunicable with an information processing device; and a controllerconfigured to cause the scanner to execute: a determination processingin which the scanner determines whether a reading request which is arequest for reading a pseudo image file is received from the informationprocessing device; a scan executing processing in which the scannerexecutes a scan processing when the scanner determines that the readingrequest for reading the pseudo image file is received in thedetermination processing; and a scan-data writing processing in whichthe scanner writes scan data created in the scan executing processing,into the pseudo image file, wherein the controller is configured tocause the scanner to execute a pseudo-image-file creating processing inwhich the scanner creates the pseudo image file, wherein in thepseudo-image-file creating processing, the scanner creates the pseudoimage file in association with one of a plurality of setting values setfor the scan executing processing, wherein in the scan executingprocessing, the scanner executes the scan processing using a settingvalue associated with the pseudo image file for which the scannerdetermines that the reading request is received in the determinationprocessing, and wherein the controller is configured to cause thescanner to further execute: a state detecting processing in which thescanner detects a state of the scanner; and a pseudo-image-file deletingprocessing in which the scanner deletes the pseudo image file created inthe pseudo-image-file creating processing and created in associationwith a particular setting value, in a case where the scanner is notallowed to execute the scan processing using the particular settingvalue in the state detected in the state acquiring processing.
 2. Thescanner according to claim 1, wherein the controller is configured tocause the scanner to execute a pseudo-image-file closing processing inwhich the scanner closes the pseudo image file after the scan data iswritten into the pseudo image file in the scan-data writing processingand the pseudo image file is read by the information processing device.3. The scanner according to claim 1, wherein in the scan executingprocessing, the scanner executes one of a first scan processing based onthe reading request for reading the pseudo image file, and a second scanprocessing different from the first scan processing, and wherein thecontroller is configured to cause the scanner to execute a restrictingprocessing in which the scanner restricts execution of the first scanprocessing in the scan executing processing when the second scanprocessing is being executed.
 4. The scanner according to claim 1,wherein in the determination processing, the scanner determines whetherthe reading request for reading the pseudo image file using one of a USBstorage class and a protocol for file sharing over a network isreceived.
 5. The scanner according to claim 1, wherein the pseudo imagefile is a named pipe.
 6. The scanner according to claim 1, wherein inthe determination processing the scanner determines whether the readingrequest for reading the pseudo image file using one of a USB storageclass and a protocol for file sharing over a network is received.
 7. Thescanner according to claim 1, wherein the pseudo image file is a namedpipe.
 8. A non-transitory storage medium storing a plurality ofinstructions executable by a processor of a scanner, the scannercomprising a communication device communicable with an informationprocessing device, the plurality of instructions, when executed by theprocessor, causing the scanner to execute: a determination processing inwhich the scanner determines whether a reading request which is arequest for reading a pseudo image file is received from the informationprocessing device; a scan executing processing in which the scannerexecutes a scan processing when the scanner determines that the readingrequest for reading the pseudo image file is received in thedetermination processing; and a scan-data writing processing in whichthe scanner writes scan data created in the scan executing processing,into the pseudo image file, wherein the instructions, when executed,further cause the scanner to execute a pseudo-image-file creatingprocessing in which the scanner creates the pseudo image file, whereinin the pseudo-image-file creating processing, the scanner creates thepseudo image file in association with one of a plurality of settingvalues set for the scan executing processing, wherein in the scanexecuting processing, the scanner executes the scan processing using asetting value associated with the pseudo image file for which thescanner determines that the reading request is received in thedetermination processing, and wherein the instructions, when executed,further cause the scanner to execute: a state detecting processing inwhich the scanner detects a state of the scanner; and apseudo-image-file deleting processing in which the scanner deletes thepseudo image file created in the pseudo-image-file creating processingand created in association with a particular setting value, in a casewhere the scanner is not allowed to execute the scan processing usingthe particular setting value in the state detected in the stateacquiring processing.
 9. The scanner according to claim 8, wherein theinstructions, when executed, further cause the scanner to execute apseudo-image-file closing processing in which the scanner closes thepseudo image file after the scan data is written into the pseudo imagefile in the scan-data writing processing and the pseudo image file isread by the information processing device.
 10. The scanner according toclaim 8, wherein in the scan executing processing, the scanner executesone of a first scan processing based on the reading request for readingthe pseudo image file, and a second scan processing different from thefirst scan processing, and wherein the instructions, when executed,further cause the scanner to execute a restricting processing in whichthe scanner restricts execution of the first scan processing in the scanexecuting processing when the second scan processing is being executed.11. The scanner according to claim 10, wherein in the restrictingprocessing, the scanner restricts the execution of the first scanprocessing in the scan executing processing by disallowing reception ofthe reading request for reading the pseudo image file.
 12. The scanneraccording to claim 10, wherein the instructions, when executed, furthercause the scanner to execute a canceling processing in which, when thesecond scan processing is finished, the scanner cancels restriction ofthe execution of the first scan processing in the restrictingprocessing.